home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / comm / tcp / amitcptelnetf.lha / amitcp_telnet+ftp / ftp / ftp_var.h < prev    next >
C/C++ Source or Header  |  1993-07-10  |  5KB  |  168 lines

  1. /*
  2.  * Copyright (c) 1985 Regents of the University of California.
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms are permitted
  6.  * provided that the above copyright notice and this paragraph are
  7.  * duplicated in all such forms and that any documentation,
  8.  * advertising materials, and other materials related to such
  9.  * distribution and use acknowledge that the software was developed
  10.  * by the University of California, Berkeley.  The name of the
  11.  * University may not be used to endorse or promote products derived
  12.  * from this software without specific prior written permission.
  13.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  14.  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  15.  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  16.  *
  17.  *    @(#)ftp_var.h    5.5 (Berkeley) 6/29/88
  18.  */
  19.  
  20. /*
  21.  * FTP global variables.
  22.  */
  23.  
  24. /*
  25.  * Options and other state info.
  26.  */
  27.  
  28. #ifndef FTPVARS
  29. extern int trace, hash, sendport, verbose, connected, fromatty,
  30.     interactive, debug, bell, doglob, autologin, proxy, proxflag,
  31.     sunique, runique, mcase, ntflag, mapflag, code, crflag;
  32. extern char *logname;
  33. extern char *dldir, *uldir;
  34. extern char pasv[64], *altarg, ntin[17], ntout[17];
  35. #else
  36. int    trace;            /* trace packets exchanged */
  37. int    hash;            /* print # for each buffer transferred */
  38. int    verbose;        /* print messages coming back from server */
  39. int    connected;        /* connected to server */
  40. int    fromatty;        /* input is from a terminal */
  41. int    interactive;        /* interactively prompt on m* cmds */
  42. int    debug;            /* debugging level */
  43. int    bell;            /* ring bell on cmd completion */
  44. int    doglob;            /* glob local file names */
  45. int    autologin;        /* establish user account on connection */
  46. int    proxy;            /* proxy server connection active */
  47. int    proxflag;        /* proxy connection exists */
  48. int    sunique;        /* store files on server with unique name */
  49. int    runique;        /* store local files with unique name */
  50. int    mcase;            /* map upper to lower case for mget names */
  51. int    ntflag;            /* use ntin ntout tables for name translation */
  52. int    mapflag;        /* use mapin mapout templates on file names */
  53. int    code;            /* return/reply code for ftp command */
  54. int    crflag;            /* if 1, strip car. rets. on ascii gets */
  55. char    pasv[64];        /* passive port for proxy data connection */
  56. char    *altarg;        /* argv[1] with no shell-like preprocessing  */
  57. char    ntin[17];        /* input translation table */
  58. char    ntout[17];        /* output translation table */
  59.  
  60. char    *logname;        /* path of file to log bytes sent/received */
  61. char    *uldir;            /* Home Directory to read files from */
  62. char    *dldir;            /* Home Directory to write files to */
  63. #endif
  64.  
  65. #ifdef AMI_TCP
  66. #define MAXPATHLEN 256
  67. #define NCARGS 32
  68. #endif
  69. #include <sys/param.h>
  70.  
  71. #ifndef FTPVARS
  72. extern char mapin[MAXPATHLEN], mapout[MAXPATHLEN], typename[32];
  73. extern char structname[32], formname[32], modename[32], bytename[32];
  74. extern int type, stru, form, mode, bytesize;
  75. extern char *hostname;
  76. extern struct servent *sp;
  77. #else
  78. char    mapin[MAXPATHLEN];    /* input map template */
  79. char    mapout[MAXPATHLEN];    /* output map template */
  80. char    typename[32];        /* name of file transfer type */
  81. int    type;            /* file transfer type */
  82. char    structname[32];        /* name of file transfer structure */
  83. int    stru;            /* file transfer structure */
  84. char    formname[32];        /* name of file transfer format */
  85. int    form;            /* file transfer format */
  86. char    modename[32];        /* name of file transfer mode */
  87. int    mode;            /* file transfer mode */
  88. char    bytename[32];        /* local byte size in ascii */
  89. int    bytesize;        /* local byte size in binary */
  90.  
  91. char    *hostname;        /* name of host connected to */
  92.  
  93. struct    servent *sp;        /* service spec for tcp/ftp */
  94. #endif
  95.  
  96. #include <setjmp.h>
  97.  
  98. #ifndef FTPVARS
  99. extern jmp_buf toplevel;
  100. extern char line[200], *stringbase, argbuf[200], *argbase, *margv[20];
  101. extern int margc, cpend, mflag, options;
  102. #else
  103. jmp_buf    toplevel;        /* non-local goto stuff for cmd scanner */
  104.  
  105. char    line[200];        /* input line buffer */
  106. char    *stringbase;        /* current scan point in line buffer */
  107. char    argbuf[200];        /* argument storage buffer */
  108. char    *argbase;        /* current storage point in arg buffer */
  109. int    margc;            /* count of arguments on input line */
  110. char    *margv[20];        /* args parsed from input line */
  111. int     cpend;                  /* flag: if != 0, then pending server reply */
  112. int    mflag;            /* flag: if != 0, then active multi command */
  113.  
  114. int    options;        /* used during socket creation */
  115. #endif
  116.  
  117. /*
  118.  * Format of command table.
  119.  */
  120. struct cmd {
  121.     char    *c_name;    /* name of command */
  122.     char    *c_help;    /* help string */
  123.     char    c_bell;        /* give bell when command completes */
  124.     char    c_conn;        /* must be connected to use command */
  125.     char    c_proxy;    /* proxy server may execute */
  126.     int    (*c_handler)();    /* function to call */
  127. };
  128.  
  129. struct macel {
  130.     char mac_name[9];    /* macro name */
  131.     char *mac_start;    /* start of macro in macbuf */
  132.     char *mac_end;        /* end of macro in macbuf */
  133. };
  134.  
  135. #ifndef FTPVARS
  136. extern int macnum;
  137. extern struct macel macros[16];
  138. extern char macbuf[4096];
  139. #else
  140. int macnum;            /* number of defined macros */
  141. struct macel macros[16];
  142. char macbuf[4096];
  143. #endif
  144.  
  145. extern    char *tail();
  146. #ifndef __SASC
  147. extern    char *index();
  148. extern    char *rindex();
  149. extern    char *strncpy();
  150. extern    char *strncat();
  151. extern    char *strcat();
  152. extern    char *strcpy();
  153. #endif
  154. extern    char *remglob();
  155. extern    int errno;
  156. extern    char *mktemp();
  157.  
  158. #if    defined(__ANSI__) || defined(sparc) || defined(__hpux)
  159. typedef void sig_t;
  160. #else
  161. typedef int sig_t;
  162. #endif
  163.  
  164. #ifdef AMI_TCP
  165. #define s_close(x) CloseSocket(x)
  166. #endif
  167.  
  168.